content = """
# 码位
>>> "你好".encode("unicode_escape").decode()
'\\u4f60\\u597d'

>>> '\u4f60\u597d'
'你好'
>>> len('\u4f60\u597d')
2

>>> "你好".encode("utf-8")
b'\xe4\xbd\xa0\xe5\xa5\xbd'

>>> b = "你好".encode("utf-8")
>>> b
b'\xe4\xbd\xa0\xe5\xa5\xbd'

>>> b = "你".encode("utf-8") + "好".encode("gbk")
>>> b
b'\xe4\xbd\xa0\xba\xc3'
>>> b.decode("utf-8")
Traceback (most recent call last):
  File "<input>", line 1, in <module>
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xba in position 3: invalid start byte
b.decode("gbk")
Traceback (most recent call last):
  File "<input>", line 1, in <module>
UnicodeDecodeError: 'gbk' codec can't decode byte 0xc3 in position 4: incomplete multibyte sequence

# creat
>>> 'a' + 'b'
'ab'

>>> a = "a"
>>> id(a)
1959968924424
>>> a = a + "b"
>>> id(a)
1960013011744

>>> a = "a"
>>> a += "b"
>>> a
'ab'

# retrieve
>>> a = "hello world"
>>> a[1]
'e'

# find
>>> a.find("e")
1
>>> a.find("l")
2

>>> a.find("m")
-1


#index
>>> a.index("e")
1

>>> a.index("m")
Traceback (most recent call last):
  File "<input>", line 1, in <module>
ValueError: substring not found

# startswith
>>> "568945656".startswith("568")
True
>>> "568945656".startswith("578")
False

#endswith
>>> "568945656".endswith("568")
False
>>> "568945656".endswith("56")
True

# update
>>> b = "abcdea"
>>> b.replace("a","z")
'zbcdez'

>>> a = "2020-12-22 17:15"
>>> a.split(" ")
['2020-12-22', '17:15']

>>> a.split(" ")[0]
'2020-12-22'

>>> b = a.split(",")
" ",join(b)
'2020-12-22 17:15'

# delete-strip
>>> " 你好 啊! " == "你好 啊!"
False
>>> " 你好 啊! ".strip() == "你好 啊!"
True

# lstrip
>>> a = "[1,2,3,4]"
>>> a.lstrip('[]')
'1,2,3,4]'

# rstrip
>>> a = "[1,2,3,4]"
>>> a.rstrip('[]')
'[1,2,3,4'

# format 按照传入参数的默认顺序
>>> a = "ping"
>>> b = "pang"
>>> "play pingpang:{},{}".format(a,b)
'play pingpang:ping,pang'

# 按照指定参数索引
a = "ping"
b = "pang"

print("play pingpang:{0},{1},{1},{1},{0}".format(a,b))

# 按照关键词参数
>>> "play pingpang:{a},{b},{b},{b},{a}".format(a="ping",b="pang")
'play pingpang:ping,pang,pang,pang,ping'

# 按照变量(高级用法)
>>> a = "ping"
>>> b= "pang"
>>> f"playing pingpang:{a},{b}"
'playing pingpang:ping,pang'

# 浮点数的处理
>>> "{:.2f}".format(3.1415926)
'3.14'
>>> "{:.5f}".format(3.1415926)
'3.14159'

"""

output = open("output.txt","w",encoding="utf-8")

output.write(content)
output.close()